home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
02
/
8
/
DISK0285.ZIP
/
DETAB.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-03-31
|
986b
|
33 lines
10 KEY OFF
30 CLS
40 PRINT "This program removes tabs from files"
45 REM
50 INPUT; "What is the name of the input file containing tabs: ",NM$
60 PRINT " "
70 OPEN NM$ FOR INPUT AS 2
80 INPUT; "What is the name of the output file: ",OUTNM1$
90 PRINT " "
100 IF NM$ <> OUTNM1$ THEN 120
110 PRINT "The output file must have a different filename" : GOTO 80
120 OPEN OUTNM1$ FOR OUTPUT AS 1
290 REM
300 WHILE ( NOT EOF(2) )
310 LINE INPUT# 2,INPFILE$
320 REM
360 HASTABS = INSTR(INPFILE$,CHR$(9))
370 WHILE HASTABS
380 BLANKFILL% = 9 - HASTABS MOD 8
390 IF BLANKFILL% = 9 THEN BLANKFILL% = 1
400 TEMP$ = MID$(INPFILE$,1,HASTABS-1)
410 TEMP$ = TEMP$ + SPACE$(BLANKFILL%)
420 INPFILE$ = TEMP$ + MID$(INPFILE$,HASTABS+1)
430 HASTABS = INSTR(INPFILE$,CHR$(9))
440 WEND
450 REM
470 PRINT #1,INPFILE$
480 WEND
485 REM
490 PRINT "detab completed"
500 CLOSE# 1,2
520 REM